package io.renren.modules.backstage.controller;

import io.renren.common.exception.Result;
import io.renren.modules.backstage.entity.RepaymentLogEntity;
import io.renren.modules.backstage.service.RepaymentLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/repaymentLog")
@CrossOrigin
public class RepaymentLogController {
    ///repaymentLog/getByBorrowId?borrowId=
    @Autowired
    RepaymentLogService repaymentLogService;

    /**
     * 查询还款记录
     * @param repaymentLogEntity
     * @return
     */
    @PostMapping("/getByRepaymentLog")
    public Result getRepaymentLogList(@RequestBody RepaymentLogEntity repaymentLogEntity){
        Result result= repaymentLogService.getRepaymentLogList(repaymentLogEntity);
        return result;
    }


    /**
     * 查询所有还款记录
     * @param
     * @return
     */
    @GetMapping("/getAll")
    public Result getAll(){
        Result result= repaymentLogService.getAll();
        return result;
    }
}
